package com.navi.loaddata.core.oracleEntity.cell1;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by Jay on 2018/3/9.
 */
public class EtlCellChipVPK implements Serializable {
    private String stepId;
    private String componentId;
    private Date componentEndTime;
    private String chipNo;

    @Column(name = "STEP_ID")
    @Id
    public String getStepId() {
        return stepId;
    }

    public void setStepId(String stepId) {
        this.stepId = stepId;
    }

    @Column(name = "COMPONENT_ID")
    @Id
    public String getComponentId() {
        return componentId;
    }

    public void setComponentId(String componentId) {
        this.componentId = componentId;
    }

    @Column(name = "COMPONENT_END_TIME")
    @Id
    @Temporal(TemporalType.TIMESTAMP)
    public Date getComponentEndTime() {
        return componentEndTime;
    }

    public void setComponentEndTime(Date componentEndTime) {
        this.componentEndTime = componentEndTime;
    }

    @Column(name = "CHIP_NO")
    @Id
    public String getChipNo() {
        return chipNo;
    }

    public void setChipNo(String chipNo) {
        this.chipNo = chipNo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        EtlCellChipVPK that = (EtlCellChipVPK) o;

        if (stepId != null ? !stepId.equals(that.stepId) : that.stepId != null) return false;
        if (componentId != null ? !componentId.equals(that.componentId) : that.componentId != null) return false;
        if (componentEndTime != null ? !componentEndTime.equals(that.componentEndTime) : that.componentEndTime != null)
            return false;
        if (chipNo != null ? !chipNo.equals(that.chipNo) : that.chipNo != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = stepId != null ? stepId.hashCode() : 0;
        result = 31 * result + (componentId != null ? componentId.hashCode() : 0);
        result = 31 * result + (componentEndTime != null ? componentEndTime.hashCode() : 0);
        result = 31 * result + (chipNo != null ? chipNo.hashCode() : 0);
        return result;
    }
}
